<script>
(function () {

try {
    var request = new XMLHttpRequest();
    request.open('GET', 'script.js', false);
    request.send('');
    alert(request.responseText);
    alert('not thrown');
} catch (exception) {
    alert('caught: ' + exception);
}
alert('not caught');

})();
</script>
